package com.jml.引用计数法;


//-verbose:gc  -XX:+PrintGCDetails  -XX:+PrintHeapAtGC（详细的gc信息）
public class 循环依赖 {
    
    private Object next;
    
    Byte[] bytes ;
    
    public 循环依赖() {
        //20兆
        this.bytes = new Byte[1024*1024*20];
    }
    
    public static void main(String[] args) {
        循环依赖 a = new 循环依赖();
        循环依赖 b = new 循环依赖();
        a.next=b;
        b.next=a;
        b=null;
        a=null;
        System.gc();
    }
}
